#include <iostream>
#define SIZE 100

using namespace std;


void read();

char characters[SIZE];
int n, k;

int main()
{
	int left, right, i = 0;
	char temp;
	read();
	left = 0;
	right = n - 1;

	while (i < k)
	{
		
		temp = characters[left];
		characters[left] = characters[right];
		characters[right] = temp;
		++left;
		--right;
		++i;
		
	}
	
	for (i = 0; i < n; ++i)
		cout << characters[i];
	
	return 0;
}

void read()
{
	int i;
	cout << "n = ";
	cin >> n;
	cout << "k = ";
	cin >> k;
	
	for (i = 0; i < n; ++i)
	{	
		cout << "characters[" << i << "]= ";
		cin >> characters[i];
	}
}